Skip to content

test: delete the tests that don't earn their keep, and tidy the rest - #192

Merged
ChristopherPHolder merged 6 commits into
mainfrom
f/test-cleanup
Nov 22, 2026
Merged

ChristopherPHolder merged 6 commits into
mainfrom
f/test-cleanup

Conversation

@ChristopherPHolder

Copy link
Copy Markdown
Collaborator

What and why

I went through every test suite to delete the tests that don't earn their keep and to tidy the rest. A test went when it only restated a string or constant from the source, only exercised Effect, Schema or another library, duplicated another test's path and assertions, or checked something the type checker already guarantees. Bug-fix regression tests, contract and wire-encoding tests, the smoke tests and the full-program tests all stay. No production code changed.

Package Before After
apps/bot 602 595
apps/console page 174 161
apps/console worker 12 12
apps/console smoke 6 6
libs/activity-sign-in 15 15
libs/design-system 37 36
libs/office-domain 36 34
libs/recording-requests 84 81
Total 966 940

Deleted tests

Restates a string or constant from the source:

  • libs/office-domain/test/RecordingRequest.test.ts: "explains each ignore reason to the person who pressed the button"
  • libs/office-domain/test/RecordingEdit.test.ts: "explains every reason it ignores an edit"
  • apps/console/src/app/recorder/notices.spec.ts: "confirms a started recording", "says where the summary goes once stopped", "confirms a pause and a resume"
  • apps/console/src/app/recorder/describe-phase.spec.ts: "asks for patience while connecting", "explains why nothing can start while the bot is away", "invites a start when idle"
  • apps/console/src/app/edits/plan.spec.ts: "are offered by name, Brief first" (STYLE_OPTIONS)
  • apps/console/src/app/history/describe-recording.spec.ts: "gives each state its badge"
  • apps/bot/test/recording/SummaryWriter.test.ts: "leaves the action items out of every style, since they're pulled out on their own" (substrings of the prompt constants)

Tests library behaviour, not ours:

  • libs/recording-requests/test/SignInHandlers.test.ts: "answers 404 to a path the API doesn't declare" (HttpApi routing)
  • apps/bot/test/answering/CloudflareDecisionModel.test.ts: "rejects an answer with a label it wasn't offered" and "rejects probabilities that don't add up" (both checks live in Effect's DecisionModel, not in our adapter)

Duplicates another test:

  • libs/recording-requests/test/RecordingHistory.test.ts: "tells running, transcribing, finished and silent recordings apart" (stateOf, already covered by RecordingStates.test.ts)
  • libs/recording-requests/test/ConsentRequests.test.ts: "is not agreed without a decision" (standingOf, already covered by "says someone who was never asked hasn't agreed")
  • libs/design-system/src/components.spec.ts: "is named by the visible text, which is its label" (folded into "is a native checkbox named by its visible label")
  • apps/console/src/app/recorder/notices.spec.ts: "includes the reason" (unreachableNotice, asserted in recorder.spec.ts)
  • apps/console/src/app/recorder/describe-phase.spec.ts: "explains a failed start" (asserted through the view in recorder.spec.ts)
  • apps/console/src/app/recorder/record-button.spec.ts: "says what pressing it does", "offers to start when nothing is recording" (both labels and presses are covered in recorder.spec.ts; the file is gone)
  • apps/bot/test/recording/audio/ClipAudio.test.ts: "has nothing for a clip it was never given" (same assertion as "gives every buffer its own audio")
  • apps/bot/test/recording/audio/ClipCutter.test.ts: "finishes the partial clip when flushed, and starts empty again" (its one extra assertion moved into the first test)
  • apps/bot/test/recording/RecordingWriter.test.ts: "leaves an item unassigned when its owner wasn't there" (covered by ownedBy in ActionItems.test.ts)

Type checker guarantees it, or a trivial pass-through:

  • apps/bot/test/recording/RecordingRequests.test.ts: "sends the recording status with times as ISO strings" (it checked a decoded value is a DateTime.Utc; the wire encoding is tested in office-domain)
  • apps/console/src/app/main.spec.ts: "keeps the clock" (TickedClock writing its payload to now)

Cleanups

  • Shared fixtures: libs/recording-requests/test/database.ts (migrations, an unreachable database, counted and stalling connections) and test/api.ts (the HTTP app the handler tests build), apps/console recorder/fixtures.ts and consent/fixtures.ts, answeringOnce in fakes.ts, and signedInAs/withSession in the bot's fakes.ts.
  • Removed unused helpers from the bot's fakes.ts (addToThread, the recorded views) and unexported its internal types.
  • Off the wall clock: the bot's Capture.test.ts and Recorder.test.ts no longer stamp clips with DateTime.nowUnsafe(), and "keeps nothing from someone who hasn't agreed" waits for an admitted speaker's clip instead of a live 10 ms sleep.
  • api.spec.ts keeps its retry reports per test instead of in module state that each test had to clear.
  • The Worker specs use it.effect instead of wrapping each body in Effect.runPromise.
  • Removed the one lint-disable comment (Config.test.ts); the line it guarded only checked Redacted's string form.
  • Predicate.isTagged instead of comparing _tag or instanceof by hand.
  • Names: dropped the numbering from Program.test.ts, and fixed misleading names in SlackMessage.test.ts and Config.test.ts.
  • Tightened "copes with a negative variant" to check that a negative variant reads as its positive.
  • Merged a one-test describe into its neighbour in office-domain.

How I tested it

pnpm vp run ci passes: typecheck, lint and format, every package's tests, the build and the smoke test. I ran the changed Capture.test.ts several times to check it doesn't flake.

Checklist

  • vp run ci passes
  • Tests cover the change
  • Docs updated if what gets posted, the configuration, the Console or the deploy changed (see CONTRIBUTING.md)
  • New environment variables are wired through (see CONTRIBUTING.md)
  • Ready to ship: merging this deploys it to production

@ChristopherPHolder
ChristopherPHolder changed the base branch from f/modest-newton-crdkfi to main November 22, 2026 14:57
@ChristopherPHolder
ChristopherPHolder marked this pull request as ready for review November 22, 2026 14:57
@ChristopherPHolder
ChristopherPHolder merged commit 86ba74d into main Nov 22, 2026
3 checks passed
@ChristopherPHolder
ChristopherPHolder deleted the f/test-cleanup branch November 22, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant